﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Sample.Database.Structure.Entity;
using Sample.Database.Structure.Interface;
using Sample.Test.Database.Mock;

namespace Sample.Test.Database
{
    public class Database
    {
        IRepository<EntityOne> entityOneRepository = new EntityOneRepositoryMock();

        [Test]
        public void CreateTest()
        {
            var entityOne = new EntityOne() { Id = 1, Text = "something" };

            entityOneRepository.Add(entityOne);

            Assert.IsTrue(entityOneRepository.Count() == 1);
            Assert.IsTrue(entityOneRepository.Find(x => x.Id == entityOne.Id).Count() == 1);
            Assert.True(entityOneRepository.Find(x => x == entityOne) != null);
        }
    }
}
